<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<script type="text/javascript" charset="utf-8"
	src="<?php echo Yii::app()->baseUrl?>/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" charset="utf-8"
	src="<?php echo Yii::app()->baseUrl?>/layer/layer.js"></script>
<script type="text/javascript" charset="utf-8"
	src="<?php echo Yii::app()->baseUrl?>/layer/modernizr.custom.js"></script>
<script type="text/javascript"
	src="<?php echo Yii::app()->baseUrl?>/kindeditor/h5Client.js"></script>
<link rel="stylesheet"
	href="http://kindeditor.net/ke4/themes/default/default.css"
	type="text/css" />
<link rel="stylesheet"
	href="<?php echo Yii::app()->baseUrl?>/css/default.css" type="text/css" />
<link rel="stylesheet"
	href="<?php echo Yii::app()->baseUrl?>/css/component.css"
	type="text/css" />
<style>
.search_btn {
	border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-bottom-right-radius: 0px;
	border-top-right-radius: 0px;
}

.am-tabs-default .am-tabs-nav>.am-active a {
	background-color: #e94e6d;
	color: #fff;
	/*           border-radius:5px;
           -webkit-border-radius:5px;
           -moz-border-radius:5px;
           border-bottom-right-radius: 0px;
           border-top-right-radius: 0px;*/
}

.am-tabs-default .am-tabs-nav a {
	background-color: #ffd5df;
	color: #222;
	line-height: 42px;
	/*            border-radius:5px;
            -webkit-border-radius:5px;
            -moz-border-radius:5px;
            border-bottom-left-radius: 0px;
            border-top-left-radius: 0px;*/
}

.middle-demo-1 {
	height: 3em;
	line-height: 3em;
	overflow: hidden;
}

.ul_li_img {
	width: 10%;
	margin-left: 1em;
}

.ul_li_span {
	font-size: 20px;
	margin-left: 1em;
}

.i_ul_rel {
	display: block;
	padding: 0 0 0 14px;
	left: -10px;
	position: relative;
	list-style-type: none;
}

.i_li_left {
	padding-left: 5px;
	width: 50%;
	position: relative;
	margin-bottom: 6px;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	float: left;
}

.i_txt {
	font-size: 16px;
	color: #323232;
	height: 20px;
	line-height: 18px;
	/*margin: 10px 0 6px;*/
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	/*padding: 0 6px;*/
	word-break: break-all;
}

.am-input-group-primary .am-input-group-btn>.am-btn,
	.am-input-group-primary .am-input-group-label, .am-input-group-primary.am-input-group .am-form-field
	{
	border-color: #e94e6d;
}

.am-tabs-default .am-tabs-nav a {
	background-color: #ffd5df;
	color: #222;
	line-height: 42px;
	border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
}

.am-tabs-bd {
	position: relative;
	overflow: hidden;
	border: 0px solid #ddd;
	border-top: none;
	z-index: 100;
	-webkit-transition: height .3s;
	transition: height .3s;
}
</style>
<script>
        function loadding(){
            layer.load(0, {shade: [0.1,"#070707"] });
            return false;
        } 
            
        function close(){
            layer.closeAll(); //疯狂模式，关闭所有层
        } 
        function selectIndex(){
            if($("#select_text").val()!=""){
                loadding();
                window.location.href="/vote/index.php/default/selectIndex?username="+$("#select_text").val(); 
                close();
            }
        }
        function vote(id){

      	  if(isWeiXin()==true)
          {
      	alert('投票需通过"智慧烟台"app,登入成功后即可参加投票！');
          }
      else
      {
    	  hgClient.getUserInfo(function(response) {

   	       var userInfo = response && (response.userInfo || response)
   					|| '';
   			userInfo = jQuery.parseJSON(JSON.stringify(userInfo));
   			var userTokenKey = userInfo.userTokenKey;
   			if (userTokenKey == null ||userTokenKey.length == 0)
   			{
   				hgClient.goLogin();
   				return false;
   			}
   			else
   			{
   	   			alert('11');
   			       loadding();

      			    var _json = jQuery.param({
    					"id" : id,
    					"openid" : userTokenKey								
    				});
    	 	            var url='<?php echo Yii::app()->baseUrl?>/index.php/default/set_vote';
    	 	         
    	 	            jQuery.ajax(
    	    	 	            {
    	    	 	            	 'url':url,
    	        	 	         'type':'POST',
    	        	 	         'async' : false,
     	        	 	       'data':_json,
     	        	 	       'dataType':'json',
         	        	 	   'cache':false,
      	 	            'complete':function(data){
    	 	              		 var dic = data.responseText;
    	 	              		 close();
 	   		                    layer.alert(dic, {icon: 6},function(index){  
 	   		                        location.reload();
 	   		                        });
    	 	                }
    	 	            });	

      }
      
        }
        function isWeiXin(){
            var ua = window.navigator.userAgent.toLowerCase();
            if(ua.match(/MicroMessenger/i) == 'micromessenger' || ua.match(/QQ/i) == "qq"){
                return true;
            }else{
                return false;
            } 
    </script>
</head>
<body style="background-color: #EEEEEE;">
	<div>
		<!--中间大图-->
		<div>
			<img style="width: 100%; height: 25%"
				src="<?php echo Yii::app()->baseUrl?>/images/粉色萌宝方案.jpg" />
		</div>
		<div style="background-color: #FFFFFF">
			<ul style="list-style-type: none; margin: 0; padding: 0;">
				<li>
					<div class="middle-demo-1">
						<a
							href="<?php echo Yii::app()->createUrl('default/message',array('id'=>1))?>">
							<img class="ul_li_img"
							src="<?php echo Yii::app()->baseUrl?>/images/iconfont-rongyujiangxiang.png" />
							<span class="ul_li_span">奖项设置</span>
						</a>
					</div>
					<hr data-am-widget="divider" style="margin-top: 0.1em;"
						class="am-divider am-divider-default" />
				</li>
				<li style="margin-top: -1em;">
					<div class="middle-demo-1">
						<a
							href="<?php echo Yii::app()->createUrl('default/message',array('id'=>2))?>">
							<img class="ul_li_img"
							src="<?php echo Yii::app()->baseUrl?>/images/iconfont-icon.png" />
							<span class="ul_li_span">报名流程</span>
						</a>
					</div>
					<hr data-am-widget="divider" style="margin-top: 0.1em;"
						class="am-divider am-divider-default" />
				</li>
				<li style="margin-top: -1em;">
					<div class="middle-demo-1">
						<a
							href="<?php echo Yii::app()->createUrl('default/message',array('id'=>3))?>">
							<img class="ul_li_img"
							src="<?php echo Yii::app()->baseUrl?>/images/iconfont-biezhen.png" />
							<span class="ul_li_span">活动介绍</span>
						</a>
					</div>
					<hr data-am-widget="divider" style="margin-top: 0.1em;"
						class="am-divider am-divider-default" />
				</li>
			</ul>
		</div>
		<!--搜索-->
		<div class="am-g">
			<div class="am-u-lg-6">
				<div class="am-input-group am-input-group-primary">
					<span class="am-input-group-btn">
						<button onclick="selectIndex()" class="am-btn am-btn-primary"
							style="background-color: #e94e6d; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-bottom-right-radius: 0px; border-top-right-radius: 0px;"
							type="button">
							<span class="am-icon-search"></span>
						</button>
					</span> <input type="text" id="select_text" placeholder="输入编号或者名称"
						class="am-form-field"
						style="padding-right: 5px; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-bottom-left-radius: 0px; border-top-left-radius: 0px;">
				</div>
			</div>
		</div>
		<div>
			<div data-am-widget="tabs" class="am-tabs am-tabs-default"
				style="background-color: #EEEEEE;">
				<ul class="am-tabs-nav am-cf">
					<li class="am-active"><a
						style="border-radius: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-bottom-right-radius: 0px; border-top-right-radius: 0px;"
						href="[data-tab-panel-0]">全部</a></li>
					<li class=""><a
						style="border-radius: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-bottom-left-radius: 0px; border-top-left-radius: 0px;"
						href="[data-tab-panel-1]">最新</a></li>
				</ul>
				<div class="am-tabs-bd"
					style="margin-left: -8px; margin-right: -10px;">
					<div data-tab-panel-0 class="am-tab-panel am-active"
						style="padding-left: 0px; padding-right: 0px;">
						<ul class="grid effect-1" id="hot_ul">
            <?php
            foreach ($model as $value) {
                ?>
           <li class="i_li_left">
								<div
									style="border: solid 1px #cdccc9; background-color: #F0F8FF;">
									<a
										href="<?php echo Yii::app()->baseUrl?>/index.php/default/children_msg/<?php echo CHtml::encode($value->id);?>">
										<div
											style="text-align: center; margin: 10px 10px; background-color: #EEEEEE;">
											<img src="<?php echo $value->head_image;?>"
												style="min-height: 150px; width: 100%; padding: 10px 10px 0px 10px;">
											<span class="i_txt"><?php echo CHtml::encode($value->id);?>号：<?php echo CHtml::encode($value->username);?></span>
										</div>
									</a>
									<div style="text-align: center; margin-bottom: 1em;">
										<button onclick="vote(<?php echo $value->id ?>)" type="button"
											class="am-btn am-btn-danger"
											style="font-size: 13px; border-radius: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px">投票</button>
										<span
											style="color: #e94e6d; margin-left: 0.5em; vertical-align: middle;"><?php echo CHtml::encode($value->number);?>票</span>
									</div>
								</div>
							</li>
           <?php
            
}
            ?>
            </ul>
					</div>
					<div data-tab-panel-1 class="am-tab-panel "
						style="padding-left: 0px; padding-right: 0px;">
						<ul class="grid effect-1" id="hot_ul2">
            <?php
            foreach ($model2 as $value) {
                ?>
           <li class="i_li_left">
								<div
									style="border: solid 1px #cdccc9; background-color: #F0F8FF;">
									<a
										href="<?php echo Yii::app()->baseUrl?>/index.php/default/children_msg/<?php echo CHtml::encode($value->id);?>">
										<div
											style="text-align: center; margin: 10px 10px; background-color: #EEEEEE;">
											<img src="<?php echo $value->head_image;?>"
												style="min-height: 150px; width: 100%; padding: 10px 10px 0px 10px;">
											<span class="i_txt"><?php echo CHtml::encode($value->id);?>号：<?php echo CHtml::encode($value->username);?></span>
										</div>
									</a>
									<div style="text-align: center; margin-bottom: 1em;">
										<button onclick="vote(<?php echo $value->id ?>)" type="button"
											class="am-btn am-btn-danger"
											style="font-size: 13px; border-radius: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px">投票</button>
										<span
											style="color: #e94e6d; margin-left: 0.5em; vertical-align: middle;"><?php echo CHtml::encode($value->number);?>票</span>
									</div>
								</div>
							</li>
           <?php
            
}
            ?>
            </ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script
		src="<?php echo Yii::app()->baseUrl?>/layer/masonry.pkgd.min.js"></script>
	<script src="<?php echo Yii::app()->baseUrl?>/layer/imagesloaded.js"></script>
	<script src="<?php echo Yii::app()->baseUrl?>/layer/classie.js"></script>
	<script src="<?php echo Yii::app()->baseUrl?>/layer/AnimOnScroll.js"></script>
	<script type="text/javascript">
new AnimOnScroll( document.getElementById( 'hot_ul' ), {
	minDuration : 0.4,
	maxDuration : 0.7,
	viewportFactor : 0.2
} );
new AnimOnScroll( document.getElementById( 'hot_ul2' ), {
	minDuration : 0.4,
	maxDuration : 0.7,
	viewportFactor : 0.2
} );
</script>
</body>
</html>
